<!DOCTYPE html>
<!-- 列出form表单中所有标签的名字，和该元素中的值。 -->
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
	<form id="myName">
		    <input id="youName" type="text" value="王五">  
		    <input id="oneName" type="text" value="张三"> 
			<input id="twoName" type="text" value="李四"> 
			<input id="threeName" type="text" value="刘海">
		<p>获取form表单中所有标签的名字</p>
	</form>
	<script type="text/javascript">
		var x = document.getElementById("myName");
		for (var i = 0; i < x.length; i++) {
			document.write("第" + i + "个节点", "值是：" + x.elements[i].value);
			document.write("<br />");
		}
	</script>
</body>
</html>